<template>
  <div class="content-box">
    <div class="scroll-view-box">
      <el-button class="history-btn" @click="hisDrawer = true" size="small">历史记录</el-button>
      <div class="data-box-left" ref="databoxleft">
        <div class="user-title-box" v-if="$fieldShowFunc('25-xmxx')">项目信息</div>
        <el-descriptions class="margin-bottom" :column="3" border>
          <el-descriptions-item label="项目名称" v-if="$fieldShowFunc('sh_xmmc')">
            <div class="justify_6_5" slot="label">项目名称</div>
            {{ asInfo.project_name }}
          </el-descriptions-item>
          <el-descriptions-item label="项目编号" v-if="$fieldShowFunc('sh_xmbh')">
            <div class="justify_6_5" slot="label">项目编号</div>
            <el-button @click="goToProjectFunc" type="text" style="padding: 0;">{{ asInfo.project_number || '--'
            }}</el-button>
          </el-descriptions-item>
          <el-descriptions-item label="项目品牌" v-if="$fieldShowFunc('sh_xmpp')">
            <div class="justify_6_5" slot="label">项目品牌</div>
            {{ asInfo.brand_name }}
          </el-descriptions-item>
          <el-descriptions-item label="项目类型" v-if="$fieldShowFunc('sh_xmlx')">
            <div class="justify_6_5" slot="label">项目类型</div>
            {{ asInfo.store_type_name }}
          </el-descriptions-item>
          <el-descriptions-item labelClassName="descriptions_opacity" contentClassName="descriptions_opacity"
            v-for="key in $fieldRowFunc(1, 4, 0)" :key="key"></el-descriptions-item>
        </el-descriptions>
        <div class="user-title-box" v-if="$fieldShowFunc('25-shxx')">售后信息</div>
        <el-descriptions class="margin-bottom" :column="3" border>
          <el-descriptions-item label="售后工单编号" v-if="$fieldShowFunc('sh_shgdbh')">
            <div class="justify_6_5" slot="label">售后工单编号</div>
            {{ asInfo.after_sales_number }}
          </el-descriptions-item>
          <el-descriptions-item label="期望上门时间" v-if="$fieldShowFunc('sh_qwsmsj')">
            <div class="justify_6_5" slot="label">期望上门时间</div>
            {{ asInfo.expected_doorstep_time || '--' }}
          </el-descriptions-item>
          <el-descriptions-item label="现场对接电话" v-if="$fieldShowFunc('sh_xcdjdh')">
            <div class="justify_6_5" slot="label">现场对接电话</div>
            {{ asInfo.scene_phone || '--' }}
          </el-descriptions-item>
          <el-descriptions-item label="售后截止日期" v-if="$fieldShowFunc('sh_shjzrq')">
            <div class="justify_6_5" slot="label">售后截止日期</div>
            {{ asInfo.warranty_deadline_date || '--' }}
          </el-descriptions-item>
          <el-descriptions-item label="是否质保期内" v-if="$fieldShowFunc('sh_sfzzbqn')">
            <div class="justify_6_5" slot="label">是否质保期内</div>
            {{ asInfo.is_sell_by == 1 ? '是' : '否' }}
          </el-descriptions-item>
          <el-descriptions-item label="发起人" v-if="$fieldShowFunc('sh_fqr')">
            <div class="justify_6_5" slot="label">发起人</div>
            {{ asInfo.user_name }}
          </el-descriptions-item>
          <el-descriptions-item label="工程监理" v-if="$fieldShowFunc('sh_gcjl')">
            <div class="justify_6_5" slot="label">工程监理</div>
            {{ asInfo.engineering_supervision_name || '--' }}
          </el-descriptions-item>
          <el-descriptions-item label="当前进度" v-if="$fieldShowFunc('sh_dqjd')">
            <div class="justify_6_5" slot="label">当前进度</div>
            <el-tooltip class="item" effect="dark" :content="speedDesc(3, asInfo)" placement="top">
              <span v-if="asInfo.after_sales_status == 10">待处理</span>
              <span v-else-if="asInfo.after_sales_status == 60">已完成</span>
              <span v-else>进行中</span>
            </el-tooltip>
          </el-descriptions-item>
          <el-descriptions-item label="图片/视频" v-if="$fieldShowFunc('sh_tpsp')">
            <div class="justify_6_5" slot="label">图片/视频</div>
            <div class="file-box-img-box flex ac" v-if="asInfo.after_sales_attachments.length">
              <div class="file-box-img" v-for="(item, idx) in asInfo.after_sales_attachments" :key="idx">
                <el-tooltip class="item" effect="dark" :content="item.file_name" placement="top">
                  <img class="img" :src="$fileImgFunc(item)" @click="$fileViewHandle(item)" />
                </el-tooltip>
              </div>
            </div>
            <span v-if="!asInfo.after_sales_attachments.length">--</span>
          </el-descriptions-item>
          <el-descriptions-item label="创建时间" v-if="$fieldShowFunc('sh_cjsj')">
            <div class="justify_6_5" slot="label">创建时间</div>
            {{ asInfo.created_at }}
          </el-descriptions-item>
          <el-descriptions-item label="售后内容" v-if="$fieldShowFunc('sh_shnr')">
            <div class="justify_6_5" slot="label">售后内容</div>
            {{ asInfo.problem_content || '--' }}
          </el-descriptions-item>
          <el-descriptions-item labelClassName="descriptions_opacity" contentClassName="descriptions_opacity"
            v-for="key in $fieldRowFunc(1, 4, 1)" :key="key"></el-descriptions-item>
        </el-descriptions>

        <template v-if="asInfo.after_sales_status > 30">
          <div class="user-title-box" v-if="$fieldShowFunc('25-xcfk')">现场反馈</div>
          <el-descriptions class="margin-bottom" :column="3" border>
            <el-descriptions-item label="是否需要集采" v-if="$fieldShowFunc('sh_sfxycjdh')">
              <div class="justify_6_5" slot="label">是否需要集采</div>
              {{ asInfo.is_order_goods == 1 ?
                '是' : '否' }}
            </el-descriptions-item>
            <el-descriptions-item label="现场核实照片" v-if="$fieldShowFunc('sh_shxchszp')">
              <div class="justify_6_5" slot="label">现场核实照片</div>
              <div class="file-box-img-box flex ac" v-if="asInfo.on_site_verification.length">
                <div class="file-box-img" v-for="(item, idx) in asInfo.on_site_verification" :key="idx">
                  <el-tooltip class="item" effect="dark" :content="item.file_name" placement="top">
                    <img class="img" :src="$fileImgFunc(item)" @click="$fileViewHandle(item)" />
                  </el-tooltip>
                </div>
              </div>
              <span v-if="asInfo.on_site_verification.length == 0">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="到场时间" v-if="$fieldShowFunc('sh_shdcsj')">
              <div class="justify_6_5" slot="label">到场时间</div>
              {{ asInfo.feedback_at || '--'}}
            </el-descriptions-item>
            <el-descriptions-item label="到场人员" v-if="$fieldShowFunc('sh_shdcry')">
              <div class="justify_6_5" slot="label">到场人员</div>
              {{ asInfo.foreman_name || '--' }}
            </el-descriptions-item>
            <el-descriptions-item label="订货需求(明细)" v-if="$fieldShowFunc('sh_shdhxqmx')">
              <div class="justify_6_5" slot="label">订货需求(明细)</div>
              {{ asInfo.order_demand || '--' }}
            </el-descriptions-item>
            <el-descriptions-item labelClassName="descriptions_opacity" contentClassName="descriptions_opacity"
              v-for="key in $fieldRowFunc(1, 4, 2)" :key="key"></el-descriptions-item>
          </el-descriptions>
        </template>
        <template v-if="asInfo.after_sales_status > 40">
          <div class="user-title-box" v-if="$fieldShowFunc('25-clxq')">处理详情</div>
          <el-descriptions class="margin-bottom" :column="3" border>
            <el-descriptions-item label="施工工程经理" v-if="$fieldShowFunc('sh_shsggcjl')">
              <div class="justify_6_5" slot="label">施工工程经理</div>
              {{ asInfo.engineering_manager_name || '--' }}
            </el-descriptions-item>
            <el-descriptions-item label="维修工程经理" v-if="$fieldShowFunc('sh_wxgcjl')">
              <div class="justify_6_5" slot="label">维修工程经理</div>
              {{ asInfo.repair_engineering_manager_name || '--' }}
            </el-descriptions-item>
            <el-descriptions-item label="限期整改日期" v-if="$fieldShowFunc('sh_xqzgsj')">
              <div class="justify_6_5" slot="label">限期整改日期</div>
              {{ asInfo.deadline_date || '--' }}
            </el-descriptions-item>
            <el-descriptions-item label="售后责任判定" v-if="$fieldShowFunc('sh_shzrpd')">
              <div class="justify_6_5" slot="label">售后责任判定</div>
              {{ asInfo.responsible_party }}
            </el-descriptions-item>
            <el-descriptions-item label="售后类型划分" v-if="$fieldShowFunc('sh_shlxhf')">
              <div class="justify_6_5" slot="label">售后类型划分</div>
              {{ asInfo.problem_type }}
            </el-descriptions-item>
            <el-descriptions-item label="售后费用" v-if="$fieldShowFunc('sh_shshfy')">
              <div class="justify_6_5" slot="label">售后费用</div>
              {{ asInfo.after_sales_expenses ? `${asInfo.after_sales_expenses}元` : '--' }}
            </el-descriptions-item>
            <el-descriptions-item label="施工费" v-if="$fieldShowFunc('sh_shsgf')">
              <div class="justify_6_5" slot="label">施工费</div>
              <el-popover placement="bottom-end" trigger="manual" :value="sgPrice" :width="width31" :offset="10"
                popper-class="price-popover" transition="el-zoom-in-top">
                <el-descriptions :column="1" direction="horizontal" border>
                  <el-descriptions-item v-if="$fieldShowFunc('sh_shclf')" label="材料费"
                    :labelStyle="{ background: '#fff', border: 'none' }" :contentStyle="{ border: 'none' }">
                    <div class="justify_6_5" slot="label">材料费</div>
                    {{ asInfo.material_cost ? `${asInfo.material_cost}元` : '--' }}
                  </el-descriptions-item>
                  <el-descriptions-item v-if="$fieldShowFunc('sh_shrgf')" label="人工费"
                    :labelStyle="{ background: '#fff', border: 'none' }" :contentStyle="{ border: 'none' }">
                    <div class="justify_6_5" slot="label">人工费</div>
                    {{ asInfo.labor_cost ? `${asInfo.labor_cost}元` : '--' }}
                  </el-descriptions-item>
                </el-descriptions>

                <div class="item-box" @click="openClick('sgPrice')" slot="reference"
                  v-if="$fieldShowFunc('sh_shclf') || $fieldShowFunc('sh_shrgf')">
                  <span class="title">{{ asInfo.construction_cost ? `${asInfo.construction_cost}元` : '--' }}</span>
                  <i :class="sgPrice ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
                </div>
                <div v-else slot="reference">
                  <span class="title">{{ asInfo.construction_cost ? `${asInfo.construction_cost}元` : '--' }}</span>
                </div>
              </el-popover>
            </el-descriptions-item>
            <el-descriptions-item v-if="$fieldShowFunc('sh_shjcf')" label="集采费">
              <div class="justify_6_5" slot="label">集采费</div>
              <el-popover placement="bottom-end" trigger="manual" :value="jcPrice" :width="width31" :offset="10"
                popper-class="price-popover" transition="el-zoom-in-top">
                <el-descriptions :column="1" direction="horizontal" border>
                  <el-descriptions-item v-if="$fieldShowFunc('sh_shdhrq')" label="订货日期"
                    :labelStyle="{ background: '#fff', border: 'none' }" :contentStyle="{ border: 'none' }">
                    <div class="justify_6_5" slot="label">订货日期</div>
                    {{ asInfo.order_time || '--' }}
                  </el-descriptions-item>
                  <el-descriptions-item v-if="$fieldShowFunc('sh_shdhrq2')" label="到货日期"
                    :labelStyle="{ background: '#fff', border: 'none' }" :contentStyle="{ border: 'none' }">
                    <div class="justify_6_5" slot="label">到货日期</div>
                    {{ asInfo.actual_arrival_time || '--' }}
                  </el-descriptions-item>
                  <el-descriptions-item v-if="$fieldShowFunc('sh_shcgzy')" label="采购专员"
                    :labelStyle="{ background: '#fff', border: 'none' }" :contentStyle="{ border: 'none' }">
                    <div class="justify_6_5" slot="label">采购专员</div>
                    {{ asInfo.name || '--' }}
                  </el-descriptions-item>
                  <el-descriptions-item v-if="$fieldShowFunc('sh_shwldh')" label="物流单号"
                    :labelStyle="{ background: '#fff', border: 'none' }" :contentStyle="{ border: 'none' }">
                    <div class="justify_6_5" slot="label">物流单号</div>
                    {{ asInfo.odd_numbers || '--' }}
                  </el-descriptions-item>
                </el-descriptions>
                <div class="item-box" @click="openClick('jcPrice')" slot="reference"
                  v-if="$fieldShowFunc('sh_shdhrq') || $fieldShowFunc('sh_shdhrq2') || $fieldShowFunc('sh_shcgzy') || $fieldShowFunc('sh_shwldh')">
                  <span class="title">{{ asInfo.total_price ? `${asInfo.total_price}元` : '--' }}</span>
                  <i :class="jcPrice ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
                </div>
                <div slot="reference" v-else>
                  <span class="title">{{ asInfo.total_price ? `${asInfo.total_price}元` : '--' }}</span>
                </div>
              </el-popover>

            </el-descriptions-item>

            <el-descriptions-item v-if="$fieldShowFunc('sh_shshwcrq')" label="售后完成日期">
              <div class="justify_6_5" slot="label">售后完成日期</div>
              {{ asInfo.completion_date || '--' }}
            </el-descriptions-item>
            <el-descriptions-item v-if="$fieldShowFunc('sh_shsx')" label="售后时效">
              <div class="justify_6_5" slot="label">售后时效</div>
              {{ asInfo.after_sales_timeliness }}天
            </el-descriptions-item>
            <el-descriptions-item v-if="$fieldShowFunc('sh_shwczpsp')" label="完成照片/视频">
              <div class="justify_6_5" slot="label">完成照片/视频</div>
              <div class="file-box-img-box flex ac" v-if="asInfo.completed_on_site.length">
                <div class="file-box-img" v-for="(item, idx) in asInfo.completed_on_site" :key="idx">
                  <el-tooltip class="item" effect="dark" :content="item.file_name" placement="top">
                    <img class="img" :src="$fileImgFunc(item)" @click="$fileViewHandle(item)" />
                  </el-tooltip>
                </div>
              </div>
              <span v-if="asInfo.completed_on_site.length == 0">--</span>
            </el-descriptions-item>
            <el-descriptions-item v-if="$fieldShowFunc('sh_shwxfyje')" label="维修费用金额">
              <div class="justify_6_5" slot="label">维修费用金额</div>
              {{ asInfo.construction_cost ? `${asInfo.construction_cost}元` : '--' }}
            </el-descriptions-item>
            <el-descriptions-item v-if="$fieldShowFunc('sh_shwxfyqd')" label="维修费用清单">
              <div class="justify_6_5" slot="label">维修费用清单</div>
              <div class="file-box-img-box flex ac">
                <div class="file-box-img" v-for="(item, idx) in asInfo.cost_list" :key="idx">
                  <el-tooltip class="item" effect="dark" :content="item.file_name" placement="top">
                    <img class="img" :src="$fileImgFunc(item)" @click="$fileViewHandle(item)" />
                  </el-tooltip>
                </div>
                <span v-if="asInfo.cost_list.length == 0">--</span>
              </div>
            </el-descriptions-item>
            <el-descriptions-item v-if="$fieldShowFunc('sh_shbzsm')" label="备注说明">
              <div class="justify_6_5" slot="label">备注说明</div>
              {{ asInfo.remark || '--' }}
            </el-descriptions-item>
            <el-descriptions-item labelClassName="descriptions_opacity" contentClassName="descriptions_opacity"
              v-for="key in $fieldRowFunc(1, 4, 3)" :key="key"></el-descriptions-item>
          </el-descriptions>
        </template>
      </div>
    </div>
    <!-- 历史弹窗 -->
    <el-drawer @close="hisDrawer = false" title="历史记录" :visible.sync="hisDrawer" :with-header="false" size="600px">
      <div class="right-box">
        <div class="title-box flex ac fw" style="margin: 20px 0 0 10px">历史记录</div>

        <el-timeline class="timeline">
          <el-timeline-item v-for="(item, index) in asInfo.log_list" :key="index">
            <div class="setp-box">
              <div class="setp-top flex ac jb">
                <p class="time">{{ item.updated_at }}</p>
                <div class="user-box flex ac">
                  <img class="avater" :src="item.handlers_image" />
                  {{ item.handlers_name + "-" + item.handlers_position }}
                </div>
              </div>
              <div class="setp-content">
                <div class="title">{{ item.content }}</div>
                <template v-if="item.after_sales_status == 10">
                  <div class="content-table">
                    <div class="flex jb fw">
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_qwsmsj')">
                        <span class="table-item-title history_justify_8">期望上门时间</span>
                        <span class="table-item-content">{{ item.form_data.expected_doorstep_time }}</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_xcdjdh')">
                        <span class="table-item-title history_justify_8">现场对接电话</span>
                        <span class="table-item-content">{{ item.form_data.scene_phone }}</span>
                      </div>
                      <div class="table-item" v-if="$fieldShowFunc('sh_shnr')">
                        <span class="table-item-title history_justify_8">售后内容</span>
                        <span class="table-item-content">{{ item.form_data.problem_content }}</span>
                      </div>
                      <div class="table-item fw width-50" v-if="$fieldShowFunc('sh_tpsp')">
                        <span class="table-item-title history_justify_8">图片/视频</span>
                        <div class="img-list-box flex ac fw">
                          <template v-for="(file, index) in item.form_data.after_sales_file">
                            <el-tooltip :key="index" class="item" effect="dark" :content="file.file_name"
                              placement="top">
                              <img @click="$fileViewHandle(file)" v-if="file.type == 1" class="img"
                                :src="$fileImgFunc(file)" />
                            </el-tooltip>
                          </template>
                        </div>
                      </div>
                    </div>
                  </div>
                </template>
                <template v-if="item.after_sales_status == 20">
                  <div class="content-table">
                    <div class="flex jb fw">
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_qwsmsj')">
                        <span class="table-item-title history_justify_8">期望上门时间</span>
                        <span class="table-item-content">{{ item.form_data.expected_doorstep_time }}</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_xcdjdh')">
                        <span class="table-item-title history_justify_8">现场对接电话</span>
                        <span class="table-item-content">{{ item.form_data.scene_phone }}</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_gcjl')">
                        <span class="table-item-title history_justify_8">工程监理</span>
                        <span class="table-item-content">{{ item.form_data.engineering_supervision_name }}</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_shnr')">
                        <span class="table-item-title history_justify_8">售后内容</span>
                        <span class="table-item-content">{{ item.form_data.problem_content }}</span>
                      </div>
                    </div>
                    <div class="table-item" v-if="$fieldShowFunc('sh_tpsp')">
                      <span class="table-item-title history_justify_8">图片/视频</span>
                      <span class="table-item-content" v-if="item.form_data.after_sales_file.length == 0">--</span>
                    </div>
                    <div class="img-list-box flex ac fw" v-if="$fieldShowFunc('sh_tpsp')">
                      <template v-for="(file, index) in item.form_data.after_sales_file">
                        <el-tooltip :key="index" class="item" effect="dark" :content="file.file_name" placement="top">
                          <img @click="$fileViewHandle(file)" v-if="file.type == 1" class="img"
                            :src="$fileImgFunc(file)" />
                        </el-tooltip>
                      </template>
                    </div>
                  </div>
                </template>
                <template v-if="item.after_sales_status == 30 && asInfo.user_position == '工程监理'">
                  <div class="content-table">
                    <div class="flex jb fw">
                      <div class="table-item width-50"
                        v-if="$fieldShowFunc('sh_shsggcjl') || $fieldShowFunc('sh_wxgcjl')">
                        <span class="table-item-title history_justify_8">工程经理</span>
                        <span class="table-item-content">{{ asInfo.repair_engineering_manager_name }}</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_shnr')">
                        <span class="table-item-title history_justify_8">售后内容</span>
                        <span class="table-item-content">{{ asInfo.problem_content }}</span>
                      </div>
                    </div>
                    <div class="table-item" v-if="$fieldShowFunc('sh_tpsp')">
                      <span class="table-item-title history_justify_8">图片/视频</span>
                    </div>
                    <div class="img-list-box flex ac fw" v-if="$fieldShowFunc('sh_tpsp')">
                      <template v-for="(file, index) in asInfo.after_sales_attachments">
                        <el-tooltip :key="index" class="item" effect="dark" :content="file.file_name" placement="top">
                          <img @click="$fileViewHandle(file)" v-if="file.type == 1" class="img"
                            :src="$fileImgFunc(file)" />
                        </el-tooltip>
                      </template>
                    </div>
                  </div>
                </template>
                <template v-if="item.after_sales_status == 40">
                  <div class="content-table">
                    <div class="flex jb fw" style="width: 100%;">
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_sfxycjdh')">
                        <span class="table-item-title history_justify_8">是否需要集采</span>
                        <span class="table-item-content">{{ item.form_data.is_order_goods == 1 ? '是' : '否' }}</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_shdhxqmx')">
                        <span class="table-item-title history_justify_8">订货需求(明细)</span>
                        <span class="table-item-content">{{ item.form_data.order_demand || '--' }}</span>
                      </div>
                    </div>
                    <div class="table-item" v-if="$fieldShowFunc('sh_shxchszp')">
                      <span class="table-item-title history_justify_8">现场核实照片</span>
                    </div>
                    <div class="img-list-box flex ac fw" v-if="$fieldShowFunc('sh_shxchszp')">
                      <template v-for="(file, index) in item.form_data.site_file">
                        <el-tooltip :key="index" class="item" effect="dark" :content="file.file_name" placement="top">
                          <img @click="$fileViewHandle(file)" class="img" :src="$fileImgFunc(file)" />
                        </el-tooltip>
                      </template>
                    </div>
                  </div>
                </template>
                <template v-if="item.after_sales_status == 50">
                  <div class="content-table">
                    <div class="flex jb fw">
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_shlxhf')">
                        <span class="table-item-title history_justify_8">售后类型划分</span>
                        <span class="table-item-content">{{ item.form_data.problem_type }}</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_shxqzgrq')">
                        <span class="table-item-title history_justify_8">限期整改日期</span>
                        <span class="table-item-content">{{ item.form_data.deadline_date }}</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_shzrpd')">
                        <span class="table-item-title history_justify_8">售后责任判定</span>
                        <span class="table-item-content">{{ item.form_data.responsible_party }}</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_shclf')">
                        <span class="table-item-title history_justify_8">材料费</span>
                        <span class="table-item-content">{{ item.form_data.material_cost }}元</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_shrgf')">
                        <span class="table-item-title history_justify_8">人工费</span>
                        <span class="table-item-content">{{ item.form_data.labor_cost }}元</span>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('sh_shsgf')">
                        <span class="table-item-title history_justify_8">施工费</span>
                        <span class="table-item-content">{{ item.form_data.construction_cost }}元</span>
                      </div>
                      <template v-if="asInfo.is_order_goods == 1">
                        <div class="table-item width-50" v-if="$fieldShowFunc('sh_shdhrq')">
                          <span class="table-item-title history_justify_8">订货日期</span>
                          <span class="table-item-content">{{ asInfo.order_time || '--' }}</span>
                        </div>
                        <div class="table-item width-50" v-if="$fieldShowFunc('sh_shdhrq2')">
                          <span class="table-item-title history_justify_8">到货日期</span>
                          <span class="table-item-content">{{ asInfo.actual_arrival_time || '--' }}</span>
                        </div>
                        <div class="table-item width-50" v-if="$fieldShowFunc('sh_shcgzy')">
                          <span class="table-item-title history_justify_8">采购专员</span>
                          <span class="table-item-content">{{ asInfo.name || '--' }}</span>
                        </div>
                        <div class="table-item width-50" v-if="$fieldShowFunc('sh_shwldh')">
                          <span class="table-item-title history_justify_8">物流单号</span>
                          <span class="table-item-content">{{ asInfo.odd_numbers || '--' }}</span>
                        </div>
                      </template>
                      <div class="table-item width-50 fw" v-if="$fieldShowFunc('sh_shwxfyqd')">
                        <span class="table-item-title history_justify_8">维修费用清单</span>
                        <span class="table-item-content" v-if="item.form_data.cost_file.length == 0">--</span>
                        <div class="img-list-box flex ac fw" v-else>
                          <template v-for="(file, index) in item.form_data.cost_file">
                            <el-tooltip :key="index" class="item" effect="dark" :content="file.file_name"
                              placement="top">
                              <img @click="$fileViewHandle(file)" class="img" :src="$fileImgFunc(file)" />
                            </el-tooltip>
                          </template>
                        </div>
                      </div>
                      <div class="table-item width-50" v-if="$fieldShowFunc('gc_shbzsm')">
                        <span class="table-item-title history_justify_8">备注</span>
                        <span class="table-item-content">{{ item.form_data.remark || '--' }}</span>
                      </div>
                    </div>

                  </div>
                </template>
                <template v-if="item.after_sales_status == 60">
                  <div class="content-table" v-if="$fieldShowFunc('sh_shwczpsp')">
                    <div class="table-item">
                      <span class="table-item-title history_justify_8">完成照片/视频</span>
                    </div>
                    <div class="img-list-box flex ac fw">
                      <template v-for="(file, index) in item.form_data.completion_file">
                        <el-tooltip :key="index" class="item" effect="dark" :content="file.file_name" placement="top">
                          <img @click="$fileViewHandle(file)" :key="index" class="img" :src="$fileImgFunc(file)" />
                        </el-tooltip>
                      </template>
                    </div>
                  </div>
                </template>
              </div>
            </div>
          </el-timeline-item>
        </el-timeline>
      </div>
    </el-drawer>
  </div>
</template>
<script>
import afterSalesApi from '@/api/afterSalesApi'
import { handleSpeedDesc } from "@/views/home/components/kj.js";

export default {
  name: "afterSalesManagementDetail",
  data() {
    return {
      sgPrice: false,
      jcPrice: false,
      width31: 0,

      asInfo: {},
      hisDrawer: false,
    };
  },
  computed: {
    speedDesc() {
      return (type, item) => {
        return handleSpeedDesc(type, item);
      }
    }
  },
  mounted() {
    window.addEventListener('resize', () => {
      this.sgPrice = false
      this.jcPrice = false
    });

    let id = this.$route.query.sn
    if (id) {
      afterSalesApi.newAfterSalesDetails({ after_sales_id: id }).then(res => {
        console.log(res, '售后详情')
        if (res.code == 200) {
          res.data.log_list.map(item => {
            item.form_data = item.form_data ? JSON.parse(item.form_data) : {}
          })
          this.asInfo = res.data;
        }
      })
    }
  },
  methods: {
    openClick(field) {
      this.width31 = (this.$refs['databoxleft'].clientWidth / 3) - 3
      this[field] = !this[field]
    },
    // 去项目详情
    goToProjectFunc() {
      this.$store.commit('isEventTriggeredFunc', true);
      this.$router.push({
        path: '/projectDetailNew',
        query: {
          id: this.asInfo.project_id
        }
      })
    },
  },
};
</script>
<style lang="scss" scoped>
@import '@/styles/detail.scss';
@import "./index.scss";
</style>